import Foundation

struct DWJsonPropertyInfo {
    
    var offset : Int
    
    var propertyKey : String
        
    var propertyType : Any.Type
            
    var subType : Any.Type? = nil
    
    var replaceKey : String? = nil
    
    var ignoreProperty : Bool = false
        
    init(offset: Int, jsonKey: String, type: Any.Type, tupleList : [DWJsonPropertyInfo]? = nil) {
        self.offset = offset
        self.propertyKey = jsonKey
        if let optionType = type as? DWJsonOptionalValue.Type {
            self.propertyType = optionType.dw_subType()
        }else {
            self.propertyType = type
        }
        if let dicType = self.propertyType as? DWJsonDictValue.Type {
            self.subType = dicType.dw_subType()
        }
        if let arrayType = self.propertyType as? DWJsonArrayValue.Type {
            self.subType = arrayType.dw_subType()
        }
    }
    
}

class DWModelInfo {
    
    var superInfo : DWModelInfo?
    
    var propertyList : [DWJsonPropertyInfo] = []
    
}
